<!DOCTYPE html>
<html lang="de">
  <head>
    <title>HomeMatic WebUI</title>
    <link rel="stylesheet" type="text/css" href="/webui/style.cgi" />

    <!-- Required meta tags for bootstrap -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=1024">

    <script type="text/javascript" src="/webui/js/extern/jquery.js"></script>
    <script type="text/javascript" src="/webui/js/extern/jqueryURLPlugin.js"></script>
    <script type="text/javascript" src="/webui/js/extern/prototype.js"></script>
    <script type="text/javascript" src="/webui/js/lang/loadTextResource.js"></script>
    <script type="text/javascript" src="/webui/js/lang/translate.js"></script>

    <script type="text/javascript">
      recalcDivs = function()
      {
        var wHeight = 0;
        if (window.innerHeight) {
          wHeight = window.innerHeight;
        }
        else if (document.documentElement.offsetHeight) {
          wHeight = document.documentElement.offsetHeight;
        }

        var wHeaderHeight = 72;
        var wFooterHeight = 32;
        var wContentHeight = wHeight - wHeaderHeight - wFooterHeight - 27;

        $("navbar").setStyle({height: wHeaderHeight + "px"});
        $("content").setStyle({height: wContentHeight + "px"});
        $("footer").setStyle({height: wFooterHeight + "px"});
      };
    </script>
  </head>
  <body>
    <table style="width: 100%; height: 100%;" cellpadding="0" cellspacing="0" id="maintable" class="j_translate">
      <tr>
        <td id="navbar">
          <table cellpadding="0" cellspacing="0">
          <tr>
            <td style="text-align: center;"><div style="width: 180px;" ><img src="/ise/img/occu-logo_small.png" alt="OpenCCU Logo" /></div></td>
            <td><span class="HeaderTitle" style="cursor: pointer;" onclick="gotoLoginPage();">${lblUsrLogin}</span></td>
              <td style="width: 100%;"></td>
              <td style="padding-right:63px;"><div class="clickable" onclick="loadHelp();"><img id="idHelp" src="/ise/img/help.png" width="48px" height="48px" alt="Hilfe" title="Hilfe"/></div></td>
          </tr>
        </table>
        </td>
      </tr>
      <tr>
        <td>
          <div id="content" style="background-repeat:no-repeat;background-position:480px center;">
            <table id="logout_content" cellspacing="8">
              <tr>
                <td style="vertical-align: top;">
                  <div style="font-weight: bold; font-size: 14px; margin-top: 20px; margin-bottom: 20px; margin-left: 5px;">${lblLogoutSuccess}</div>
                  <div id="btnLogNew" class="Button colorGradient" onclick="GoIndexPageNAL();">${btnNewLogin}</div>
                </td>
              </tr>
            </table>
          </div>
        </td>
      </tr>
      <tr>
        <td id="footer">
        </td>
      </tr>
    </table>

    <script type="text/javascript">
      Event.observe(window, "resize", function(event) { recalcDivs(); });
      recalcDivs();

      gotoLoginPage = function() {
        location.href = "/login.htm";
      };

      loadHelp = function()
      {
        var opts = {
          evalScripts: true,
          postBody: "from=logout",
          sendXML: false
        };
        //var url = "/config/help.cgi?sid="+SessionId;
        var url = "/config/help.cgi";
        new Ajax.Updater("content", url, opts);
      };

      GoIndexPageNAL = function() {
        location.href = "/pages/index.htm?NoAutoLogin=true";
        <%
          var oUser = dom.GetObject( system.GetSessionVar("sessionUserID") );
          if ( oUser )
          {
            if (oUser.UserLevel() <= 1)
            {
              system.ClearSessionID();
            }
            else
            {
              system.ClearSession();
            }
          }
          else
          {
            system.ClearSession();
          }
        %>
      };
      try {window.history.pushState({},document.title, "/logout.htm?lang="+getLang()); } catch (e) {}
      translatePage("#maintable");
      translateAttribute("#idHelp", "title", "tooltipHelp");
    </script>

  </body>
</html>
